package xyz.talentboy.controller.message;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import xyz.talentboy.common.util.MessageUtil;
import xyz.talentboy.service.ICoreMessageService;

@RestController
@SuppressWarnings("unchecked")
public class MessageController {
	
	private static final Logger logger = LoggerFactory.getLogger(MessageController.class);
	
	@Autowired
	private ICoreMessageService coreMessageService;
	
	@RequestMapping(value = "/signature")
	public String reviceMessage(HttpServletRequest request) {
		Map<String,String> commonMessage = MessageUtil.parseXml(request);
		logger.info(commonMessage.toString());
		//初步业务处理
		return coreMessageService.dispatcherMessage(commonMessage);
	}
		
}
